#ifndef LIGHT_PANEL_H
#define LIGHT_PANEL_H
#include "example.h"

typedef enum{
  YELLOW=0,
  RED,
  GREEN,
  DARK
}PANEL_COLOR;

//--灯板字段设置&占空比设置
#define PANEL_CODE(pos,code)    (*((uint32_t*)(MMIO_BASE+pos*4))=(code))
#define PANEL_PWM(cycle,duty)   (*((uint32_t*)(MMIO_BASE+0x40))= ((cycle&0x1F)<<16) +(duty&0x1F) )

//--设置灯板显示码值和占空比
void LightPanel_Print(uint32_t *code);                                                 
void LightPanel_SetPwm(uint8_t cycle, uint8_t duty);       /*> cycle：最大31         */
void FM25Q16_Init();
void Convert_GB2312_to_Code(uint32_t Gb2312Code,uint32_t* WordCode,PANEL_COLOR color);
void Light_select_color(uint32_t* WordCode,PANEL_COLOR color);
void light_work();
void bling_work();
#endif